3.4 \(\int \frac{\sin (x)}{i+\cot (x)} \, dx\)

Optimal. Leaf size=25 \[ \frac{2}{3} i \cos (x)+\frac{i \sin (x)}{3 (\cot (x)+i)} \]

[Out]

((2*I)/3)*Cos[x] + ((I/3)*Sin[x])/(I + Cot[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0299948, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3502, 2638} \[ \frac{2}{3} i \cos (x)+\frac{i \sin (x)}{3 (\cot (x)+i)} \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]/(I + Cot[x]),x]

[Out]

((2*I)/3)*Cos[x] + ((I/3)*Sin[x])/(I + Cot[x])

Rule 3502

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^n)/(b*f*(m + 2*n)), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\sin (x)}{i+\cot (x)} \, dx &=\frac{i \sin (x)}{3 (i+\cot (x))}-\frac{2}{3} i \int \sin (x) \, dx\\ &=\frac{2}{3} i \cos (x)+\frac{i \sin (x)}{3 (i+\cot (x))}\\ \end{align*}

Mathematica [A]  time = 0.0431948, size = 27, normalized size = 1.08 \[ \frac{1}{6} (\sin (x)+i \cos (x)) (2 i \sin (2 x)+\cos (2 x)+3) \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/(I + Cot[x]),x]

[Out]

((I*Cos[x] + Sin[x])*(3 + Cos[2*x] + (2*I)*Sin[2*x]))/6

________________________________________________________________________________________

Maple [B]  time = 0.055, size = 47, normalized size = 1.9 \begin{align*}{-i \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-2}}+{\frac{2}{3} \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-3}}+{\frac{1}{2} \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-1}}-{\frac{1}{2} \left ( \tan \left ({\frac{x}{2}} \right ) +i \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(I+cot(x)),x)

[Out]

-I/(tan(1/2*x)-I)^2+2/3/(tan(1/2*x)-I)^3+1/2/(tan(1/2*x)-I)-1/2/(tan(1/2*x)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+cot(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.56445, size = 96, normalized size = 3.84 \begin{align*} \frac{1}{12} \,{\left ({\left (3 i \, e^{\left (2 i \, x\right )} + 3 i\right )} e^{\left (2 i \, x\right )} + 3 i \, e^{\left (2 i \, x\right )} - i\right )} e^{\left (-3 i \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+cot(x)),x, algorithm="fricas")

[Out]

1/12*((3*I*e^(2*I*x) + 3*I)*e^(2*I*x) + 3*I*e^(2*I*x) - I)*e^(-3*I*x)

________________________________________________________________________________________

Sympy [A]  time = 0.373806, size = 26, normalized size = 1.04 \begin{align*} \frac{i e^{i x}}{4} + \frac{i e^{- i x}}{2} - \frac{i e^{- 3 i x}}{12} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+cot(x)),x)

[Out]

I*exp(I*x)/4 + I*exp(-I*x)/2 - I*exp(-3*I*x)/12

________________________________________________________________________________________

Giac [B]  time = 1.22285, size = 50, normalized size = 2. \begin{align*} -\frac{1}{2 \,{\left (\tan \left (\frac{1}{2} \, x\right ) + i\right )}} + \frac{3 \, \tan \left (\frac{1}{2} \, x\right )^{2} - 12 i \, \tan \left (\frac{1}{2} \, x\right ) - 5}{6 \,{\left (\tan \left (\frac{1}{2} \, x\right ) - i\right )}^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+cot(x)),x, algorithm="giac")

[Out]

-1/2/(tan(1/2*x) + I) + 1/6*(3*tan(1/2*x)^2 - 12*I*tan(1/2*x) - 5)/(tan(1/2*x) - I)^3